package com.ccys.doctor.controller;

import com.ccys.common.vo.ResponseResultApp;
import com.ccys.db.dto.doctor.patientNote.CreatePatientNoteDto;
import com.ccys.db.vo.doctor.patientNote.FindPagePatientNoteVo;
import com.ccys.db.vo.doctor.patientNote.GetConsultNoteForEditVo;
import com.ccys.doctor.service.PatientNoteService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @program: WhiteCoat
 * @description: 患者备忘录接口
 * @author: ZhangJingCan
 * @create: 2024-02-05 15:54
 **/
@RestController
@Api(tags = "患者备忘录接口")
@RequestMapping("patientNote")
public class PatientNoteController {

    @Autowired
    private PatientNoteService patientNoteService;

    /**
     * 触发时机：问诊时医生给患者添加的
     *
     * @param dto
     * @return
     */
    @ApiOperation("创建患者备忘录")
    @PostMapping(value = "/CreatePatientNote")
    public ResponseResultApp<FindPagePatientNoteVo> createPatientNote(@RequestBody CreatePatientNoteDto dto) {
        return patientNoteService.createPatientNote(dto);
    }

    @ApiOperation("分页获取患者备忘录")
    @GetMapping(value = "/GetPatientNote")
    public ResponseResultApp<FindPagePatientNoteVo> getPatientNote(String member_id, Integer page_index, Integer page_size) {
        return patientNoteService.getPatientNote(member_id, page_index, page_size);
    }

    @ApiOperation("删除患者备忘录")
    @PostMapping(value = "/DeletePatientNote")
    public ResponseResultApp<FindPagePatientNoteVo> deletePatientNote(@RequestBody CreatePatientNoteDto dto) {
        return patientNoteService.deletePatientNote(dto);
    }

    @ApiOperation("获取咨询备注以进行编辑")
    @GetMapping(value = "/GetConsultNoteForEdit")
    public ResponseResultApp<GetConsultNoteForEditVo> getConsultNoteForEdit(String id) {
        return patientNoteService.getConsultNoteForEdit(id);
    }


}
